package com.autumn.xa.a.offerdemo;

/**
 * ClassName: Single
 *
 * @Description:
 * @Author: wangqiuyang
 * @Date: 2022/6/17 11:30 上午
 * History:
 * <author>          <time>          <version>          <desc>
 * wangqiuyang    2022/6/17 11:30 上午   @Version 1.0        描述
 */
public class Single {

    private static Single INSTANCE;

    private Single () {

    }

    public Single getInstance() {
        // DCL
        if (INSTANCE == null) {
            // 双重检查
            synchronized (Single.class) {
                if (INSTANCE == null) {
                    INSTANCE = new Single();
                }
            }
        }
        return INSTANCE;
    }
}
